package org.jbit.news.util;

import java.util.List;

import org.jbit.news.entity.News;

public class Page {
	//总页数
	private int totalPageCount=0;
	//每页显示条数
	private int pageSize=15;
	//总记录数
	private int totalCount;
	//当前页码
	private int currPageNo=1;
	//每页显示新闻集合
	private List<News> newsList;
	public int getTotalCount() {
		return totalCount;
	}
	public void setTotalCount(int totalCount) {
		if (totalCount>0) {
			this.totalCount = totalCount;
			totalPageCount=this.totalCount%pageSize==0 ? 
					(this.totalCount/pageSize):(this.totalCount/pageSize+1);
					
		}
	}
	public int getTotalPageCount() {
		return totalPageCount;
	}
	public void setTotalPageCount(int totalPageCount) {
		this.totalPageCount = totalPageCount;
	}
	public int getPageSize() {
			return pageSize;
	}
	public void setPageSize(int pageSize) {
		if (pageSize>0) {
			this.pageSize = pageSize;
		}
	}
	public int getCurrPageNo() {
		if (totalPageCount==0) {
			return 0;
		}
		return currPageNo;
	}
	public void setCurrPageNo(int currPageNo) {
		if (currPageNo>0) {
			this.currPageNo = currPageNo;
		}
	}
	public List<News> getNewsList() {
		return newsList;
	}
	public void setNewsList(List<News> newsList) {
		this.newsList = newsList;
	}
	
	
}
